@extends('admin.layouts.layout')
@section('content')
<div class="row">
    <div class="col-sm-12">
        <div class="ibox-title">
            <h5>企业账单薄</h5>
        </div>
        <div class="ibox-title">
             <a href="{{route('accounting.index')}}" link-url="javascript:void(0)"><button class="btn btn-primary btn-sm" type="button"> 企业账单薄管理</button></a>   
       </div>
            <div class="ibox-content" style="display: block;">
                <form role="form" class="form-inline">
                    <div class="form-group">
                        <label for="exampleInputEmail2" class="control-label">创建时长</label>
                        <select class="form-control" name="createTime">
                            <option selected="" value="0">全部</option>
                            <option value="1">3个月以下</option>
                            <option value="2">3-6个月</option>
                            <option value="3">6-12个月</option>
                            <option value="4">12个月以上</option>
                        </select>

                        <label for="exampleInputEmail2" class="control-label">创建来源</label>
                        <select class="form-control" name="companyType">
                            <option value="0">全部</option>
                            <option value="1">直营财务公司</option>
                            <option value="2">代理商旗下财务公司</option>
                        </select>
                    </div>

                    <div class="input-group">
                        <input type="text" name="nameLike" class="form-control" placeholder="输入关键字快速查找公司">
                        <span class="input-group-btn"> 
                            <button type="submit" class="btn btn-primary">搜索</button> 
                        </span>                                       
                    </div>                    
                </form>
            </div>
                  
        <div class="ibox-content">
                <table class="table table-striped table-bordered table-hover m-t-md">
                    <thead>
                    <tr>
                        <th class="text-center" width="100">序号</th>
                        <th class="text-center" width="100">企业名称</th>
                        <th class="text-center" width="150">所在地</th>
                        <th class="text-center" width="100">法人姓名</th>
                        <th class="text-center" width="100">纳税人性质</th>
                        <th class="text-center" width="80">企业准则</th>
                        <th class="text-center" width="80">账薄来源</th>
                        <th class="text-center" width="80">创建时间</th>
                        <th class="text-center" width="100">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($accountings as $key=>$item) 
                        <tr>
                            <td class="text-center">{{$item->id}}</td>
                            <td class="text-center">{{$item->name}}</td>
                            <td class="text-center">{{$item->province}}-{{$item->city}}-{{$item->area}}</td>
                            <td class="text-center">{{$item->legal_person}}</td>                           
                            <td class="text-center">{{$item->taxpayer_property_id}}</td>  
                            <td class="text-center">{{$item->accounting_system_id}}</td>
                            <td class="text-center">{{$item->company_name}}-{{$item->company_type}}</td>
                            <td class="text-center">{{$item->create_date}}</td>                                                       
                            <td class="text-center">                       
                               <div class="btn-group">
                               <a href="{{route('accounting.details',$item->id)}}" >
                                    <!--<a href="javascript:;" class="detailx" onclick="return detail({{$item->id}});">-->
                                        <button class="btn btn-primary btn-xs" type="button"><i class="fa fa-paste"></i> 账薄详情</button>
                                    </a>
                                </div>
                            </td>

                        </tr>
                    @endforeach()
                    </tbody>
                </table>
            <div class="pull-right pagination m-t-no">
                <div class="text-center">
                    {{$accountings->links()}}
                </div>
                <div>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>
<script src="{{loadEdition('/js/jquery.min.js')}}"></script>
<script type="text/javascript">
function detail(id){	
	layer.open({
		  title:'账薄详情', 
		  type: 2,
		  area: ['700px', '760px'],
		  fixed: false, //不固定
		  maxmin: true,
		  content: "{{route('accounting.details',"+id+")}}"
		});
}
</script> 
@endsection
 